import service from "../utils/request";

//01 注册  tel   password 
export function user_dofinishregister(payload = {}){
    return service.post('api/user/dofinishregister', payload )
}
//02 登录 loginname   password 
export function user_login(payload = {}){
    return service.post('api/user/login', payload )
}
//03 验证是否被注册  tel  
export function user_docheckphone(payload = {}){
    return service.post('api/user/docheckphone', payload )
}
//04 获取城市列表
export function sortCity(payload = {}){
    return service.get('city/sortCity.json',  {params:payload} )
}

//05 获取用户信息  token userid
export function user_info(payload = {}){
    return service.get('api/user/info',  {params:payload})
}

//06 绑定用户名  token userid  username
export function user_bindusername(payload = {}){
    return service.get('api/user/bindusername',  {params:payload} )
}
//07 修改密码  token userid  oldpassword  newpassword
export function user_updatePassword(payload = {}){
    return service.get('api/user/updatePassword', {params:payload} )
}

//08 发送短信验证码  tel  
export function user_dosendmsgcode(payload = {}){
    return service.post('api/user/dosendmsgcode', payload )
}
//09 手机号和验证码一起验证登录   tel  telcode
export function user_docheckcode(payload = {}){
    return service.post('api/user/docheckcode', payload )
}

//10 轮播图 
export function banner_list(payload = {}){
    return service.get('api/banner/list', {params:payload} )
}
//11 产品分类列表 
export function pro_categorylist(payload = {}){
    return service.get('api/pro/categorylist', {params:payload} )
}
//12 秒杀产品列表 count  limitNum 
export function pro_seckilllist(payload = {}){
    return service.get('api/pro/seckilllist', {params:payload} )
}
//13 获取商品分页列表 count  limitNum 
export function pro_list(payload = {}){
    return service.get('api/pro/list', {params:payload} )
}
//14 获取商品详情 proid
export function pro_detail(e){
    return service.get('api/pro/detail/'+ e)
}
//15  Pro - 产品分类 下品牌列表category
export function pro_categorybrandlist(payload = {}){
    return service.get('api/pro/categorybrandlist',{params:payload})
}
//16   获取某分类下某品牌的产品列表  count limitNum  category brand
export function pro_categorybrandprolist(payload = {}){
    return service.get('api/pro/categorybrandprolist',{params:payload})
}
//17 购物车列表   userid 
export function cart_list(payload = {}){
    return service.post('api/cart/list', payload )
}
//18 加入购物车   userid   proid  num
export function cart_add(payload = {}){
    return service.post('api/cart/add', payload )
}
//19 更新购物车 cartid  num
export function cart_updatenum(payload = {}){
    return service.post('api/cart/updatenum', payload )
}
//20 删除单条数据   cartid
export function cart_remove(payload = {}){
    return service.post('api/cart/remove', payload )
}
//21 删除购物车所有的数据   userid
export function cart_removeall(payload = {}){
    return service.post('api/cart/removeall', payload )
}
//22 更新购物车所有商品的选中状态   userid  type
export function cart_selectall(payload = {}){
    return service.post('api/cart/selectall', payload )
}
//23 更新单个商品的选中状态   cartid  flag
export function cart_selectone(payload = {}){
    return service.post('api/cart/selectone', payload )
}
//24 热门搜索
export function pro_hotword(payload = {}){
    return service.get('api/pro/hotword', {params:payload} )
}
//25 关键词搜索 keyword count limitNum 
export function pro_search(payload = {}){
    return service.get('api/pro/search', {params:payload} )
}

//26 地址新增
export function address_add(payload = {}){
    return service.post('api/address/add', payload )
}
//27 收货地址列表  userid
export function address_list(payload = {}){
    return service.get('api/address/list', {params:payload} )
}
//28 地址删除
export function address_delete(payload = {}){
    return service.post('api/address/delete', payload )
}
//29 地址更新
export function address_update(payload = {}){
    return service.post('api/address/update', payload )
}
//30 查询默认地址  userid
export function address_defaultAddress(payload = {}){
    return service.post('api/address/defaultAddress', payload )
}
//31 添加订单  userid
export function order_addOrder(payload = {}){
    return service.post('api/order/addOrder', payload )
}
//32 获取确认订单的信息  userid
export function order_confirmOrder(payload = {}){
    return service.get('api/order/confirmOrder', {params:payload} )
}
//33 支付时删除购物车选中的数据  userid
export function order_deleteCartItem(payload = {}){
    return service.get('api/order/deleteCartItem', {params:payload} )
}
//34 获取推荐产品列表的数据  count limitNum
export function pro_recommendlist(payload = {}){
    return service.get('api/pro/recommendlist', {params:payload} )
}
//35 获取全部订单  userid
export function user_orderlist(payload = {}){
    return service.get('api/user/orderlist',{params:payload})
}
//36  修改订单地址  
export function order_updateOrderAddress(payload = {}){
    return service.post('api/order/updateOrderAddress', payload )
}








